<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
    <head>
        <meta charset="UTF-8">
        <title>北京卫戍区东城第四离职干部修养所</title>
        <meta name="renderer" content="webkit">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
		<link rel="stylesheet" href="static/bootstrap/css/bootstrap.css">
		<script src="static/bootstrap/js/bootstrap.js"></script>

		<link rel="stylesheet" href="static/css/font.css">
        <link rel="stylesheet" href="static/css/xadmin.css">
        <script type="text/javascript" src="static/lib/layui/layui.js" charset="utf-8"></script>
        <script type="text/javascript" src="static/js/xadmin.js"></script>
        <script type="text/javascript" src="static/js/jquery.min.js"></script>
        <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
        <!--[if lt IE 9]>
          <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
          <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
        <![endif]-->
        <style type="text/css">
        	#datetime{
        		font-size: 20px;
        	}
        	#img1{
        		 filter: alpha(opacity=50); opacity:0.8;
        	}
        	 #tr1{
        		background-color: #F7F7F7;
        	}
        	#tr2{
        		background-color: #F7F7F7;
        	}
        	#tr3{
        		background-color: #F7F7F7;
        	}
        	body {
				background-color: #2874A6;
			}
			td{
				font-size: 40px;
			}
        </style>
	</head>
    <body>
        <div class="layui-fluid">
            <div class="layui-row layui-col-space15">
                <div class="layui-col-md12"></div>

				<div id="div1">
					<table class="table table-bordered" width="100%" id="d2" style="background-color: #2874A6;border:6px;border-top: none;border-left: none;border-right: none">
						<thead style="background-color: #2874A6">
							<tr style="background-color: #2874A6">
								<td style="text-align: center; color: white; font-size: 50px;height: 90px;font-family: 微软雅黑;border-top: none;border-left: none;border-right: none" colspan="9" height="50px">
									<strong>北京卫戍区东城第四离职干部休养所</strong>
								</td>
							</tr>
							<tr style="background-color: #2874A6;color: white;height: 70px;">
								<th style="font-size: 40px;height: 70px;text-align: center;"><strong>车牌号</strong></th>
								<th hidden>车型</th>
								<th style="font-size: 40px;height: 70px;text-align: center;"><strong>驾驶员</strong></th>
<!--								<th width="300" style="font-size: 40px"><strong>任务描述</strong></th>-->
								<th style="font-size: 40px;text-align: center;"><strong>预计出场时间</strong></th>
<!--								<th style="font-size: 30px"><strong>出场时间</strong></th>-->
								<th style="font-size: 40px;text-align: center;"><strong>预计回场时间</strong></th>
<!--								<th style="font-size: 30px"><strong>回场时间</strong></th>-->
								<th style="font-size: 40px;text-align: center;"><strong>状态</strong></th>
							</tr>
						</thead>
						<tbody id="tab">

						</tbody>
					</table>
				</div>
            </div>
        </div>
		<script>
			layui.use('table', function(){
  var table = layui.table;
	 
	 		var a=$.ajax({url:"/TCar/findstatus",async:false});
	 		console.log(a);
	 		var b=$.ajax({url:"/TCar/findstatus1",async:false});
	 		console.log(b);

	 		var u = a.responseJSON.data;
	 		var u1 = b.responseJSON.data;
	 		console.log(u);
	 		console.log(u1);
			 
	 		
			 for (var i = 0; i < u1.length; i++) {
				 var s = "";
				 if (u1[i].t_status=="1"){
				 	s+="<tr style='color: lawngreen;font-size: 40px;font-family: 粗体;height: 70px;border: 10px;' border=\"10\" cellpadding=\"10\" cellspacing=\"5\">";
				 }else if(u1[i].t_status=="2"){
				 	s+="<tr style='color: white;font-size: 40px;height: 70px;border: 3px' border=\"10\" cellpadding=\"10\" cellspacing=\"5\">";
				 }
				  s+= "<td style=\"font-size: 40px;text-align: center;\">" +u1[i].t_car_no +"</td>" +
						  "<td hidden><strong>" +u1[i].type_name +"</strong></td>" +
						  "<td style=\"font-size: 40px;text-align: center;\">" +u1[i].t_drive_name +"</td>";
						  // "<td style=\"font-size: 40px\"><strong>" +u1[i].t_cause +"</strong></td>";

					 s+="<td style=\"font-size: 40px;text-align: center;\">"+u1[i].t_guji_storage_time + "</td>";
					 // if(u1[i].t_storage_time!=undefined && u1[i].t_storage_time!=""){
						//  s+="<td style=\"font-size: 30px\"><strong>"+u1[i].t_storage_time + "</strong></td>";
					 // }else(
						// 	 s+="<td style=\"font-size: 30px\"><strong>暂无出场纪录</strong></td>"
						// 	 )
					 
					 s+="<td style=\"font-size: 40px;text-align: center;\">"+u1[i].t_guji_reture_time + "</td>";
					 // if(u1[i].t_return_time!=undefined && u1[i].t_return_time!=""){
						//  s+="<td style=\"font-size: 20px\">"+u1[i].t_return_time + "</td>";
					 // }else(
						// 	 s+="<td style=\"font-size: 20px\">暂无回场记录</td>"
						// 	 )

					 if(u1[i].t_status=="1"){
						 s+="<td style=\"font-size: 40px;text-align: center;\"><span class=\" \">"+ u1[i].status_name + "</span></td>"
					 }else if(u1[i].t_status=="2"){
						 s+="<td style=\"font-size: 40px;text-align: center;\"><span class=\" \">"+ u1[i].status_name + "</span></td>"
					 }
					 s+="</tr>";
				 $("#tab").append(s);
			 }
			 
			 for (var i = 0; i < u.length; i++) {
				 var s = "<tr><td>"
						 + u[i].t_car_no + "</td>" +
						 "<td hidden>" + u[i].type_name  + "</td>" +
						 "<td colspan=\"2\">" + u[i].t_drive_name+ "</td></tr>";
				 $("#tab1").append(s);
			 }
			 
			 var num=$.ajax({url:"/TCar/findAll",async:false});

				var num1 = num.responseJSON.data.length;
				console.log(num1);
				$("#num1").text(num1);

				var num2 = b.responseJSON.data.length;
				console.log(num2);
				$("#num2").text(num2);

				var num3 = a.responseJSON.data.length;
				console.log(num3);
				$("#num3").text(num3);
				
			/* var man=$.ajax({url:"/TCar/finddutydate", async:false});
			var man1 = man.responseJSON.data[0];
			console.log(man1);
			$("#man1").text(man1.duty_leader);
			$("#man2").text(man1.duty_man); */
			function timeStr() {
				var str;
				var hh = new Date().getHours();
				if (hh < 10) hh = '0' + hh;
				var mm = new Date().getMinutes();
				if (mm < 10) mm = '0' + mm;
				var ss = new Date().getSeconds();
				if (ss < 10) ss = '0' + ss;
				var yy = new Date().getYear();
				if (yy < 1900) yy = yy + 1900;
				var MM = new Date().getMonth() + 1;
				if (MM < 10) MM = '0' + MM;
				var dd = new Date().getDate();
				if (dd < 10) dd = '0' + dd;
				var ww = new Date().getDay();
				if (ww == 0) ww = "星期日";
				if (ww == 1) ww = "星期一";
				if (ww == 2) ww = "星期二";
				if (ww == 3) ww = "星期三";
				if (ww == 4) ww = "星期四";
				if (ww == 5) ww = "星期五";
				if (ww == 6) ww = "星期六";
				str = yy + "年" + MM + "月" + dd + "日" + hh + ":" + mm + ":" + ss + " " + ww;
					return (str);
			}
			timeText();
			function timeText()	{
				var domStr = timeStr();
				$("#datetime").text("当前时间："+domStr);
				setTimeout(timeText,1000);
			}
});

			//列表自动滚动
			function scrollNews() {
				var $news = $('#tab');
				var $lineHeight = $news.find('tr:first').height();
				$news.animate({ 'marginTop': -$lineHeight + 'px' }, 20000, function () {
					$news.css({ margin: 0 }).find('tr:first').appendTo($news);
				});
			};

			var scrollTimer = null;
			var delay = 2000;
			scrollTimer = setInterval(function () {
				scrollNews();
			}, delay);

			setTimeout(function(){location.reload()},200000); //指定5秒刷新一次
		</script>
    </body>
    
</html>